<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>if</title>
  <script type="text/javascript">
	var a = 2;
	var b = 4;
	/*if(a>b){
		alert("a大于b");	
	}else{
		alert("a不大于b");	
	}*/

/*
	if(a == 1){
		alert("a等于1");
	}else if(a == 2){
		alert("a等于2");
	}else if(a == 3){
		alert("a等于3");
	}else if(a == 4){
		alert("a等于4");
	}else {
		alert("a不等于1，2，3，4");
	}*/

  switch(a){
	case 1: alert("a等于1");break;
	case 2: alert("a等于2");break;
	case 3: alert("a等于3");break;
	default:alert("a不等于1，2，3");break;

  }


  </script>
 </head>
 <body>
  
 </body>
</html>
